<?php

require_once 'conn.php';
$conn;

$sql = "select * from t_message";
$result = $conn ->query($sql);

//print_r($result);

echo "<pre>";

//print_r($result ->fetch_array());
//print_r($result ->fetch_assoc());
$rows = $result -> fetch_all(MYSQLI_ASSOC);
print_r($rows);
foreach ($rows as $value) {
    //echo $value;
    echo "</br>";
    echo $value['username']."说： ".$value['content'];
}

